#@layout()
#define main()
<h1>房屋信息管理&nbsp;&nbsp;
	#if(session.user.role == 2)
      <a href="/house/add">创建房屋信息</a>
	#end
</h1>
#include("_search.html")
<div class="table_box">
	<table class="list">
		<tbody>
			<tr>
				<th width="4%" style="text-align:center;">id</th>
				<th width="15%" style="text-align:center;">楼盘名字</th>
				<th width="15%" style="text-align:center;">楼盘位置</th>
				<th width="15%" style="text-align:center;">租赁价格</th>
				<th width="15%" style="text-align:center;">租赁状态</th>
				<th width="15%" style="text-align:center;">发布者</th>
				#if(session.user.role == 2||session.user.role == 1)
				    <th width="15%" style="text-align:center;">操作</th>
				#end
			</tr>
			
			#for(x : housePage.getList())
			<tr>
				<td style="text-align:center;">#(x.id)</td>
				<td style="text-align:center;">#(x.housename)</td>
				<td style="text-align:center;">#(x.houselocation)</td>
				<td style="text-align:center;">#(x.price)</td>
				<td style="text-align:center;">
					#if(x.status == 1)
					    未出租
					#else if(x.status == 2)
					    已出租
					#else
					    正在出租
					#end
				</td>
				<td style="text-align:center;">#(x.publisher)</td>
				#if(session.user.role == 2)
				<td style="text-align:center;">
					#if(x.status==1)
					&nbsp;&nbsp;<a href="/house/delete/#(x.id)">删除</a>
					&nbsp;&nbsp;<a href="/house/edit/#(x.id)">修改</a>
					#end
				</td>
				#end
				#if(session.user.role == 1)
				<td style="text-align:center;">
					#if(x.status==1)
					  &nbsp;&nbsp;<a href="/house/lease/#(x.id)">租赁</a>
					#end
				</td>
				#end
			</tr>
			#end
		</tbody>
	</table>
	#@paginate(housePage.pageNumber, housePage.totalPage, "/house/")
</div>
#end